<?php  
/**
* View
* Отображение
* @author IT studio IRBIS-team
* @copyright © 2009 IRBIS-team
*/
/////////////////////////////////////////////////////////

/**
* Generation of page of an error at access out of system
* Генерация страницы ошибки при доступе вне системы
*/
    if(!defined('IRB_KEY'))
    {
       header("HTTP/1.1 404 Not Found");      
       exit(file_get_contents('../../404.html'));
    }    
///////////////////////////////////////////////////////////

    $POST = htmlChars($POST);
	
/** 
* Includes the template
* Подключаем шаблон
*/
	switch($GET['rem'])
		{
/** 
* Show all domains
* Смотрим все домены
*/	
		case 'read':		
			include './skins/tpl/'. $modul .'/show.tpl';
			break;
/** 
* Show domain
* Смотрим домен
*/	
		case 'domain':
			$cur_user_id = (int)$_SESSION['user_data']['id'];
			$cur_dom_id = (int)$GET['id'];
			$role = userRoleInDomain($cur_user_id,$cur_dom_id);
			
			switch($role)
			{
				case '10':
					include './skins/tpl/'. $modul .'/domain_user.tpl';
					break;
				case '100':
					include './skins/tpl/'. $modul .'/domain_edit_admin.tpl';
					break;
				case '1000':
					include './skins/tpl/'. $modul .'/domain_edit_admin.tpl';
					break;
				
				default:
					include './skins/tpl/'. $modul .'/domain.tpl';
			}			
			break;
/** 
* Add domain
* Создаем домен
*/	
		case 'add_domain':		
			include './skins/tpl/'. $modul .'/add_domain.tpl';
			break;
		
		default:
			include './skins/tpl/'. $modul .'/show.tpl';
			break;
		}
